library(tidyverse)
library(readr)
library(ggplot2)
knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)Final Project Assignment#1: Nanci Kopecky
Part 1. Introduction
- Data set(s) Introduction:
311 Service Requests is a data set on Analyze Boston data.boston.gov, an open-source data website run by the City of Boston. Residents can make service requests by phone or with an app. For 2023, there are 74,930 service requests so far. Each row represents a service request. There are 29 columns. Each column contains detailed information on each service request including the description, time, date, location, and city department/domain. Service requests are about maintenance, repair, cleaning, and policy.
- What questions do you like to answer with this data set(s)?
Questions that could inform city officials could be the following:
Do residents use the phone or app more to make requests? Does certain time of the day, week, or month receive more requests? What type of service requests are made in each neighborhood? Are the proportions of On Time service requests the same for each neighborhood? for each city department? What type of service requests are made in each neighborhood? Which city department receives the most service requests?
Part 2. Describe the data set(s)
- Read the data set.
This data set is read in with a url.
Boston311 <- read.csv(url("https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/e6013a93-1321-4f2a-bf91-8d8a02f1e62f/download/tmpo8qm0oqd.csv"))
Boston311Bos311 <- as.data.frame.matrix(Boston311)
Bos311- Descriptive information of the data set(s)
dim(Boston311)[1] 74930 29
head(Boston311)- Summary statistics of the dataset(s). This data set does not have numerical data so frequencies and percentages will summarize the categorical variables. Below are just a few of the categorical variables.
Frequency and Proportions of Service Requests by Department
prop.table(table(Bos311$subject))
Animal Control Boston Police Department
1.186441e-02 2.455625e-03
Boston Water & Sewer Commission Inspectional Services
4.684372e-03 6.435340e-02
Mayor's 24 Hour Hotline Neighborhood Services
3.377819e-02 9.342053e-05
Parks & Recreation Department Property Management
3.870279e-02 7.807287e-03
Public Works Department Transportation - Traffic Division
5.689177e-01 2.673429e-01
table(Bos311$subject)
Animal Control Boston Police Department
889 184
Boston Water & Sewer Commission Inspectional Services
351 4822
Mayor's 24 Hour Hotline Neighborhood Services
2531 7
Parks & Recreation Department Property Management
2900 585
Public Works Department Transportation - Traffic Division
42629 20032
ggplot(Bos311, aes(subject)) +
geom_bar() +
coord_flip()
table(Bos311$source)
Citizens Connect App City Worker App Constituent Call
34688 7559 29407
Employee Generated Maximo Integration Self Service
1501 1 1774
prop.table(table(Bos311$source, Bos311$neighborhood))
Allston
Citizens Connect App 4.671026e-04 3.736821e-04 1.734953e-03
City Worker App 5.338316e-05 2.669158e-05 2.402242e-04
Constituent Call 2.135326e-04 7.860670e-03 1.508074e-03
Employee Generated 5.338316e-05 1.094355e-03 1.067663e-04
Maximo Integration 0.000000e+00 1.334579e-05 0.000000e+00
Self Service 0.000000e+00 2.001868e-04 5.338316e-05
Allston / Brighton Back Bay Beacon Hill
Citizens Connect App 3.489924e-02 2.518350e-02 1.522755e-02
City Worker App 5.018017e-03 6.085680e-03 7.273455e-03
Constituent Call 2.581076e-02 1.087682e-02 6.219138e-03
Employee Generated 1.361271e-03 8.941679e-04 1.601495e-04
Maximo Integration 0.000000e+00 0.000000e+00 0.000000e+00
Self Service 2.615775e-03 9.608968e-04 2.669158e-04
Boston Brighton Charlestown Dorchester
Citizens Connect App 1.801682e-02 3.042840e-03 1.732283e-02 6.056319e-02
City Worker App 3.136261e-03 1.868411e-04 3.016148e-03 8.581343e-03
Constituent Call 1.067663e-02 2.482317e-03 9.822501e-03 7.432270e-02
Employee Generated 7.607100e-04 2.402242e-04 7.874016e-04 3.283064e-03
Maximo Integration 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
Self Service 3.202989e-04 2.669158e-04 7.607100e-04 3.883625e-03
Downtown / Financial District East Boston
Citizens Connect App 2.573068e-02 4.320032e-02
City Worker App 8.567997e-03 8.874950e-03
Constituent Call 1.287869e-02 2.663820e-02
Employee Generated 5.872147e-04 4.137195e-04
Maximo Integration 0.000000e+00 0.000000e+00
Self Service 1.094355e-03 9.075137e-04
Fenway / Kenmore / Audubon Circle / Longwood
Citizens Connect App 1.043641e-02
City Worker App 1.267850e-03
Constituent Call 4.817830e-03
Employee Generated 2.402242e-04
Maximo Integration 0.000000e+00
Self Service 2.936074e-04
Greater Mattapan Hyde Park Jamaica Plain Mattapan
Citizens Connect App 1.373282e-02 9.795809e-03 2.522354e-02 5.605232e-04
City Worker App 5.284933e-03 7.486988e-03 3.523288e-03 3.336447e-04
Constituent Call 2.850661e-02 2.208728e-02 2.543707e-02 1.734953e-03
Employee Generated 1.374616e-03 8.407847e-04 2.188709e-03 6.672895e-05
Maximo Integration 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
Self Service 1.321233e-03 1.681569e-03 1.561457e-03 6.672895e-05
Mission Hill Roslindale Roxbury South Boston
Citizens Connect App 7.967436e-03 1.361271e-02 2.982784e-02 5.244895e-03
City Worker App 1.761644e-03 2.602429e-03 9.795809e-03 6.405979e-04
Constituent Call 7.019885e-03 1.701588e-02 4.405445e-02 3.283064e-03
Employee Generated 3.336447e-04 8.274389e-04 2.175364e-03 1.201121e-04
Maximo Integration 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
Self Service 5.471774e-04 1.534766e-03 1.441345e-03 1.601495e-04
South Boston / South Boston Waterfront South End
Citizens Connect App 4.836514e-02 4.334712e-02
City Worker App 4.524223e-03 7.847324e-03
Constituent Call 2.182037e-02 1.143734e-02
Employee Generated 1.067663e-03 4.537568e-04
Maximo Integration 0.000000e+00 0.000000e+00
Self Service 9.075137e-04 7.073268e-04
West Roxbury
Citizens Connect App 9.061791e-03
City Worker App 4.751101e-03
Constituent Call 1.593487e-02
Employee Generated 6.005605e-04
Maximo Integration 0.000000e+00
Self Service 2.121981e-03
ggplot(Bos311, aes(source)) +
geom_bar() +
coord_flip()
3. The Tentative Plan for Visualization
- Briefly describe what data analyses (please the special note on statistics in the next section) and visualizations you plan to conduct to answer the research questions you proposed above.
I would like to present bar graphs and maps answer the questions in part one.
This example shows proportion of On Time service requests by neighborhood.
ggplot(Bos311, aes(neighborhood)) +
geom_bar(aes(fill = ontime), position = "fill") +
labs(title = "311 Service Requests for 2023", x = "Neighborhood", y = "Count") +
coord_flip()
- Explain why you choose to conduct these specific data analyses and visualizations.
The bar graphs and tables can show if any variable, such as a type of request, particular department or neighborhoods are unusually high. Understanding the where the demands are can help the city be more efficient in terms of assigning resources, management, and communication.
- If you plan to conduct specific data analyses and visualizations, describe how do you need to process and prepare the tidy data.
Special Note on the role of statistics
After more in depth exploratory analysis, I may decide to conduct chi-square tests to see if there is an assoication between certain variables.